﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using FirebirdSql.Data.FirebirdClient;
using SendMailApplication.DataType;

namespace SendMailApplication.Helper
{
    class DTMailInfo : IParseObj
    {
        List<object> IParseObj.excute(FbDataReader dr)
        {
            MailObj obj = null;
            List<object> result = new List<object>();

            while (dr.Read())
            {
                obj = new MailObj();
                obj.passWd = dr.GetValue(0).ToString();
                obj.fromAddress = dr.GetValue(1).ToString();
                obj.filePath = dr.GetValue(2).ToString();
                obj.contentPath = dr.GetValue(3).ToString();
                obj.toAddress = dr.GetValue(4).ToString();
                obj.mclid = Convert.ToInt32(dr.GetValue(5));
                obj.subject = dr.GetValue(6).ToString();
                obj.service = dr.GetValue(7).ToString();
                result.Add(obj);
            }

            return result;
        }
    }
}
